import re

str = 'GigabitEthernet0/0         172.16.103.146  YES NVRAM  up                    up      '

# result = re.match('(\w+\d+)\s(\d{1,3}.+\d{1,3}.\d{1,3}.\d{1,3})\s(YES|NO)\s(\w)\s(up|down)\s(up|down)\s',str).groups()
result = re.match('(\w.*\d)\s+(\d{1,3}.+\d{1,3}.+\d{1,3}.+\d{1,3})\s+(YES|NO)\s+(\w+)\s+(up|down)\s+(up|down)',str).groups()

print('{0:<5} : {1:<}'.format('接口',result[0]))
print('{0:<5} : {1:<}'.format('IP地址',result[1]))
print('{0:<5} : {1:<}'.format('状态',result[4]))
